package com.atguigu.spzx.manager.controller;

import com.atguigu.spzx.common.log.service.AsyncSysOperLogService;
import com.atguigu.spzx.model.dto.system.SysOperLogDto;
import com.atguigu.spzx.model.entity.system.SysOperLog;
import com.atguigu.spzx.model.vo.common.Result;
import com.atguigu.spzx.model.vo.common.ResultCodeEnum;
import com.github.pagehelper.PageInfo;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName: SysOperLogController
 * @Package: com.atguigu.spzx.manager.controller
 * @Description 日志操作
 * @Author 孤妤
 * @Date: 2023/12/12 13:05
 */
@Tag(name = "日志操作")
@RestController
@RequestMapping("/admin/system/sysOperLog")
public class SysOperLogController {
    @Autowired
    private AsyncSysOperLogService asyncSysOperLogService;
    @GetMapping("/{pageNum}/{pageSize}")
    @Operation(summary = "分页查询日志操作")
    public Result<PageInfo<SysOperLog>> findSysOperLogPage(@PathVariable Integer pageNum,
                                                           @PathVariable Integer pageSize,
                                                           SysOperLogDto sysOperLogDto){
        PageInfo<SysOperLog> pageInfo = asyncSysOperLogService.findSysOperLogPage(pageNum,pageSize,sysOperLogDto);
        return Result.build(pageInfo, ResultCodeEnum.SUCCESS);
    }
}
